<template>
	<view class="content">
		
		<view class="rows" v-for="(item,index) in rowsList" :key="index" @tap="ToDetails(item)">
			<image class="cover" :src="item.cover" mode=""></image>
			<view class="right">
				<view class="title overflow_one">{{item.title}}</view>
				<view class="rule overflow_two">{{item.rule}}</view>
				<view class="price fontSemiBold">¥ {{item.price}}</view>
				<view class="footer">
					<image class="icon" src="/pages_kafei/pages/static/icon_4.png" mode=""></image>
					<view class="prices fontSemiBold">¥ {{item.vipPrice}}</view>
					<view class="clearBoth"></view>
				</view>
				<image class="addIcon" src="../static/icon_5.png" mode=""></image>
				<view class="clearBoth"></view>
			</view>
			<view class="clearBoth"></view>
		</view>
		
		
		
		
		
	</view>
</template>
<style>
	.content{}
	.content .rows{width:90%;margin-left: 5%;padding:3% 5%;margin-top:0upx;margin-bottom: 40upx;}
	.content .rows .cover{width: 160upx;height: 160upx;float: left;margin-right: 20upx;border-radius: 10upx;}
	.content .rows .right{width:70%;height: 160upx;float: left;position: relative;}
	.content .rows .right .title{font-weight: bold;}
	.content .rows .right .rule{color:#999999;font-size: 22upx;margin-top: 4upx;}
	.content .rows .right .price{color:#DC582A;font-size: 32upx;margin-top:10upx}
	.content .rows .right .footer{}
	.content .rows .right .footer .icon{width: 48upx;height:28upx;float: left;}
	.content .rows .right .footer .prices{color:#262626;font-size: 32upx;float: left;margin-left: 20upx;}
	.content .rows .addIcon{width: 44upx;height:44upx;position: absolute;right:5%;bottom:0upx;z-index: 2;}
</style>
<script>
	import Share from '@/common/wx_share.js'
	export default {
		data() {
			return {
				share:{
					title:"",
					path:'/pages/tabbar/index',
					imageUrl:'',
					desc:'',
					content:''
				},
				rowsList:[
					// {
					// 	id:1,
					// 	cover:"../../../static/index/login/login.png",
					// 	title:"标标题标题标标题标题标题标题标题题标题标题标题题",
					// 	rule:"这是规格",
					// 	price:123,
					// 	vipPrice:12,
					// },
					// {
					// 	id:1,
					// 	cover:"../../../static/index/login/login.png",
					// 	title:"标标题标题标标题标题标题标题标题题标题标题标题题",
					// 	rule:"这是规格",
					// 	price:123,
					// 	vipPrice:12,
					// }
				],
				pages:1,
				id:"",
				
				
				
				
				
				
			}
		},
		onLoad(e){
			// this.id = e.id
			this.AjaxLoad(e.model_id,e.machine_code)
		},
		onReachBottom(){
			this.pages++
			this.AjaxLoad()
		},
		methods: {
			AjaxLoad(model_id,machineCode){
				var rowsList = []
				let param={
					token:this._$userToken("userInfo").token,
					// model_id:model_id,
					machineCode:machineCode,
				};
				this._$InitRequest.request("coffee/getGoodsListByCode", param).then(res => {
					
					res.data.forEach( (item,index) =>{
						rowsList.push({
							cover:item.goods_url,
							title:item.goods_name,
							rule:item.remark,
							price:item.price,
							vipPrice:item.vip_price,
							goods_id:item.goods_id,
							machineCode:item.machineCode,
							model_id:item.model_id,
						})
					})
					for (var i = 0; i < rowsList.length; i++){this.rowsList.push( rowsList[i] )}
					
				},error=>{})
			},
			ToDetails(item){
				uni.navigateTo({
					url:"/pages_kafei/pages/details/details?goods_id=" + item.goods_id + "&machineCode=" + item.machineCode + "&model_id=" + item.model_id
				})
			},
			
		}
	}
</script>
<style lang="scss" scoped>
/deep/ .uni-input-input {font-size:32upx}
/deep/ .uni-radio-input-checked{background-color:rgb(110,43,34) !important;border:2upx solid white !important}
.content .html{
  ::v-deep {
    img {
      width: 100%;
    }
  }
}
</style>